/*
 * Tile.h
 *
 *  Created on: 22/06/2011
 *      Author: Rafael
 */

#ifndef TILE_H_
#define TILE_H_

#include "rect.hpp"
#include "entity/GameObject.h"

#include <map>
using namespace std;


class Tile : public e2d::core::Rect{
private:
	bool rigid;
	map<int, GameObject*> objects; // Objects inside in tile
public:
	Tile(bool rigid, int x, int y, int w, int h);
	virtual ~Tile();

	virtual void onEnter(Model *model) = 0;
	virtual void onInside(Model *model) = 0;
	virtual void onLeave(Model *model) = 0;

	void add(GameObject* obj);
	void remove(int ID);
	bool isOnTheTile(int ID);

    bool getRigid() const;
    void setRigid(bool rigid);
};

#endif /* TILE_H_ */
